package com.zmn.oms.common.constant;

import com.google.common.collect.Lists;
import com.zmn.common.dictionary.DictModel;

import java.util.List;
import java.util.Objects;

/**
 * 类描述：厂商配件常量
 *
 * @author wangxiaokun
 * @since 2020/9/22 17:13
 */
public class OrderFactoryPartConsts {

    /**
     * 邮寄对象
     */
    public final static int POST_USER_ADDRESS = 1; // 寄给用户
    public final static int POST_YEYX_ADDRESS = 2; // 寄给言而有信公司

    /**
     * 申请方式
     */
    public final static int BACK_ADD = 1; // 后台添加
    public final static int FACTORY_ADD = 2; // 厂商添加
    public final static int ENGINEER_APPLY = 3; // 工程师申请

    /**
     * 获取邮寄对象集合
     * @return java.util.List<com.zmn.common.dictionary.DictModel>
     * @author wangxiaokun
     */
    public static List<DictModel> getPostAddressTypeList() {
        List<DictModel> items = Lists.newArrayListWithCapacity(2);
        items.add(new DictModel(POST_USER_ADDRESS, "邮寄至用户"));
        items.add(new DictModel(POST_YEYX_ADDRESS, "邮寄至言而有信公司"));
        return items;
    }

    /**
     * 获取邮寄对象名称
     * @param type
     * @return java.lang.String
     * @author wangxiaokun
     */
    public static String getPostAddressTypeName(Integer type){
        if (Objects.isNull(type)){
            return "";
        }
        switch (type){
            case POST_USER_ADDRESS:
                return "用户";
            case POST_YEYX_ADDRESS:
                return "言而有信公司";
            default:
                return "未知";
        }
    }

    /**
     * 根据申请方式获取申请方式名称
     * @param applyType 
     * @return java.lang.String
     * @author wangxiaokun
     */
    public static String getApplyTypeName(Integer applyType){
        if (Objects.isNull(applyType)){
            return "";
        }

        switch (applyType){
            case BACK_ADD:
                return "后台添加";
            case FACTORY_ADD:
                return "厂商添加";
            case ENGINEER_APPLY:
                return "工程师申请";
            default:
                return "未知";
        }

    }
}
